<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>超市</title>
    <link rel="stylesheet" href="../layuiadmin/layui/css/layui.css">
    <link rel="stylesheet" href="./css/chaoshi.css">
</head>
<style>
    html,
    body,
    div {
        width: 100%;
        height: 100%;
    }
</style>

<body>
    <script src="./css/jquery-3.2.0.min.js"></script>
    <script src="../layuiadmin/layui/layui.js"></script>
    <script src="./css/shop.js"></script>
    <div class="layui-card">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">主题市场</li>
                <li>女装</li>
                <li>男装</li>
                <li>婴儿</li>
                <li>美妆</li>
                <li>生活用品</li>
                <li>图书</li>
                <li>医药</li>
                <li>汽车</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="cat1">
                        <form class="layui-form" action="">
                            <div class="layui-form-item">
                                <label class="layui-form-label">宝贝搜索</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="title" required lay-verify="required" placeholder="宝贝" autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-input-inline">
                                    <button type="button" class="layui-btn layui-btn-normal">搜索</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="cat2">
                        <div class="cattiv">
                            <ul id="tivul">

                            </ul>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">内容2</div>
                <div class="layui-tab-item">内容3</div>
                <div class="layui-tab-item">内容4</div>
                <div class="layui-tab-item">内容5</div>
                <div class="layui-tab-item">内容5</div>
                <div class="layui-tab-item">内容5</div>
                <div class="layui-tab-item">内容5</div>
                <div class="layui-tab-item">内容5</div>
            </div>
        </div>
    </div>

</body>
<script>
    layui.config({
        base: '../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');
    layui.use(['table', 'layer', 'element'], function() {
        var table = layui.table,
            layer = layui.layer,
            element = layui.element;

        $.ajax({
            type: "get",
            url: "css/chaoshi.json",
            data: "",
            success: function(su) {
                if (su.code == 200) {
                    var data = su.data;
                    var str = ''
                    for (var i = 0; i < data.length; i++) {
                        str += '<li>' +
                            '<div id="tivli" class="tivli">' +
                            ' <a lay-href="../shop/gouwu.html?data=' + data[i].id + ',' + data[i].url + '">' +
                            ' <div class="tiv_div1">' +
                            '     <img src="' + data[i].img + '" alt="">' +
                            '   </div>' +
                            '   <div class="tiv_div2">' +
                            '  <p>' + data[i].text + '</p>' +
                            '  </div>' +
                            '   </a>' +
                            '  </div>' +
                            '  </li>'
                    }
                    $("#tivul").append(str)
                }
            },
            error: function(e) {

            }
        })

    })
</script>
<script>
</script>

</html>